#include "problems/22.h"
#include "gtest/gtest.h"
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

TEST(TestProblemSolutions, TestProblem22)
{
    problem_22::Solution s;
    vector<string> ans{"((()))",
                       "(()())",
                       "(())()",
                       "()(())",
                       "()()()"};
    sort(ans.begin(), ans.end());
    auto result = s.generateParenthesis(3);
    sort(result.begin(), result.end());

    ASSERT_EQ(result.size(), ans.size());
    for (int i = 0; i < ans.size(); ++i)
    {
        ASSERT_EQ(result[i], ans[i]);
    }
}